package com.liao.seckill.controller;

import com.liao.seckill.pojo.User;
import com.liao.seckill.service.UserService;
import com.liao.seckill.vo.RespBean;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author lzp
 * @version 1.0
 * lzpnb!
 */

@Controller
@RequestMapping("/user")
public class UserController {

    @Resource
    private UserService userService;

//    @RequestMapping("/info")
//    @ResponseBody
//    public RespBean info(User user,String address){
//        System.out.println("address = " + address);
//        return RespBean.success(user);
//    }

    @RequestMapping("/info")
    @ResponseBody
    public RespBean info(User user) {
        return RespBean.success(user);
    }


    @RequestMapping("/updpwd")
    @ResponseBody
    public  RespBean updatePassword(String userTicket, String password, HttpServletRequest request, HttpServletResponse response){
        return userService.updatePassword(userTicket,password,request,response);
    }

}
